//---------------------------------------------------------------------------

#ifndef SDPFlashH
#define SDPFlashH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Dialogs.hpp>
#include <Menus.hpp>
#include <Buttons.hpp>
#include "CSPIN.h"
#include <NMUDP.hpp>
//---------------------------------------------------------------------------
class TFForm : public TForm
{
__published:	// IDE-managed Components
        TMemo *Memo;
        TMainMenu *MMain;
        TMenuItem *MNFile;
        TMenuItem *MNOpen;
        TMenuItem *MNExit;
        TOpenDialog *OD;
        TGroupBox *GBBtns;
        TBitBtn *BtnFOpen;
        TGroupBox *GBStat;
        TCSpinEdit *EditPort;
        TEdit *EditIP;
        TBitBtn *BtnIPSave;
        TLabel *Label1;
        TBitBtn *BtnInit;
        TBitBtn *BtnBlkSend;
        TBitBtn *BtnFlash;
        TNMUDP *UDP;
        TLabel *Label2;
        TComboBox *CBDesc;
        TLabel *Label3;
        TEdit *EditFAddr;
        TCheckBox *CheckBox1;
        void __fastcall BtnFOpenClick(TObject *Sender);
        void __fastcall BtnIPSaveClick(TObject *Sender);
        void __fastcall FormActivate(TObject *Sender);
        void __fastcall BtnInitClick(TObject *Sender);
        void __fastcall BtnBlkSendClick(TObject *Sender);
        void __fastcall BtnFlashClick(TObject *Sender);
        void __fastcall UDPDataReceived(TComponent *Sender,
          int NumberBytes, AnsiString FromIP, int Port);
        void __fastcall CBDescChange(TObject *Sender);
private:	// User declarations
public:		// User declarations
int __fastcall SendPacket(char *data, unsigned int datalen, unsigned short opcode);
unsigned int __fastcall CalcCSum(char *data, unsigned int datalen);


char arg[900], IniFile[900];
        __fastcall TFForm(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TFForm *FForm;
//---------------------------------------------------------------------------
#endif
